#include "widget.h"
#include "ui_widget.h"
#include <QPixmap>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->label->setGeometry(0,0,800,600);
    ui->label->setPixmap(QPixmap(":/doge.png"));
    ui->label->setScaledContents(true);
}
//重写resizeEvent方法
void Widget::resizeEvent(QResizeEvent* event)
{
    ui->label->setGeometry(0,0,event->size().width(),event->size().height());
}
Widget::~Widget()
{
    delete ui;
}

